package com.syf.kit.config;

import com.syf.kit.cont.RdsDSCont;
import com.syf.kit.core.dao.mapper.MapperType;
import com.syf.kit.core.ds.config.PooledRdsDbConfig;
import com.syf.kit.enums.DataSourceType;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

@Data
@ConfigurationProperties("kit.rds-dao")
public class SyRdsDaoConfiguration {
    /**
     * 未开启事务，是否为自动提交，默认为true
     */
    private Boolean autoCommit = Boolean.TRUE;

    /**
     * mapper框架类型
     */
    private String mapper_frame_type = MapperType.MYBATIS_PLUS.getName();

    /**
     * 与cn.hutool.core.util.StrUtil。RDSType中rdsName一一对应
     * */
    @NotNull
    private String rdsType;

    @NotNull
    private String rdsDriverClass;

    private String dataSourceType = DataSourceType.SINGLE.getTypeName();

    private String defaultDsName = RdsDSCont.DEFAULT_DS_NAME;

    @NotNull
    private List<PooledRdsDbConfig> jdbcConfig = new ArrayList<>();
}
